Crate libp2p_identity
source ·Expand description
A node’s network identity keys.
Such identity keys can be randomly generated on every startup,
but using already existing, fixed keys is usually required.
Though libp2p uses other crates (e.g. ed25519_dalek
) internally,
such details are not exposed as part of libp2p’s public interface
to keep them easily upgradable or replaceable (e.g. to ed25519_zebra
).
Consequently, keys of external ed25519 or secp256k1 crates cannot be
directly converted into libp2p network identities.
Instead, loading fixed keys must use the standard, thus more portable
binary representation of the specific key type
(e.g. ed25519 binary format).
All key types have functions to enable conversion to/from their binary representations.
Modules
- ecdsa
ecdsa
ECDSA keys with secp256r1 curve support. - ed25519
ed25519
Ed25519 keys. - rsa
rsa
and non-WebAssemblyRSA keys. - secp256k1
secp256k1
Secp256k1 keys.
Structs
- An error during decoding of key material.
- Error produced when failing to convert
Keypair
to a more concrete keypair. - PeerId
peerid
Identifier of a peer of the network. - An error during signing of a message.
Enums
- The type of key a
KeyPair
is holding. - Keypair
ecdsa
orsecp256k1
ored25519
orrsa
Identity keypair of a node. - ParseError
peerid
- PublicKey
ecdsa
orsecp256k1
ored25519
orrsa
The public key of a node’s identity keypair.